//
//  FLMBackProfitCell.m
//  FLMSuperS
//
//  Created by xiaoyang on 16/9/20.
//  Copyright © 2016年 FaLaoMiaoNetworkTechnologyCo. All rights reserved.
//

#import "FLMBackProfitCell.h"

@implementation FLMBackProfitCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self.contentView addSubview:self.bigImgV];
        [self.contentView addSubview:self.whiteImgV];
        [self.contentView addSubview:self.priceImgV];
        [self.contentView addSubview:self.priceL];
        [self.contentView addSubview:self.titleL];
        [self.contentView addSubview:self.endTimeImgV];
        [self creatEndTimeTitle];
        [self.contentView addSubview:self.backImgV];
        [self.contentView addSubview:self.numImgV];
        [self.contentView addSubview:self.secKillBtn];
        [self.numImgV addSubview:self.numSellL];
        [self.backImgV addSubview:self.yuGuBackL];
        
    }
    
    return self;
    
}

#pragma mark-正方实物图
-(UIImageView *)bigImgV{
    
    if (!_bigImgV) {
        
        _bigImgV = [[UIImageView alloc]initWithFrame:CGRectMake(GETSIZE(5), GETSIZE(10), ScreenW/2-GETSIZE(5), GETSIZE(245))];
        _bigImgV.image = [UIImage imageNamed:@"bingXiang"];
    }
    
    return _bigImgV;
}


#pragma mark-白色梯形
-(UIImageView *)whiteImgV{
    
    if (!_whiteImgV) {
        
        _whiteImgV = [[UIImageView alloc]initWithFrame:CGRectMake(self.bigImgV.right/2, GETSIZE(10), ScreenW-self.bigImgV.right/2-GETSIZE(5), GETSIZE(245))];
        _whiteImgV.image = [UIImage imageNamed:@"whiteTi"];
    }
    
    return _whiteImgV;
}


#pragma mark-价格标签
-(UIImageView *)priceImgV{
    
    if (!_priceImgV) {
        
        _priceImgV = [[UIImageView alloc]initWithFrame:CGRectMake(self.bigImgV.right/2, self.bigImgV.height/2, GETSIZE(90), GETSIZE(50))];
        _priceImgV.image = [UIImage imageNamed:@"price"];
        
    }
    
    return _priceImgV;
    
}

-(SLable *)priceL{
    
    if (!_priceL) {
        
        _priceL = [[SLable alloc]initWithFrame:self.priceImgV.frame Text:@"¥168.00" Font:16 Color:Red textAligMent:NSTextAlignmentCenter];
    }
    
    return _priceL;
}


#pragma mark-标题
-(SLable *)titleL{
    
    if (!_titleL) {
        
        _titleL = [[SLable alloc]initWithFrame:CGRectMake(GETSIZE(200), GETSIZE(20), GETSIZE(156), GETSIZE(80)) Text:@"节目视频被我反复看了几遍每一次都有新的感悟。在展示的PPT里马特从一个台式计算机" Font:16 Color:black textAligMent:NSTextAlignmentCenter];
        _titleL.numberOfLines = 0;
        _titleL.backgroundColor = [UIColor brownColor];

    }
    
    return _titleL;
}


#pragma mark-活动结束时间
-(UIImageView *)endTimeImgV{
    
    if (!_endTimeImgV) {
        
        _endTimeImgV = [[UIImageView alloc]initWithFrame:CGRectMake(GETSIZE(210), _titleL.bottom+GETSIZE(7), GETSIZE(140), GETSIZE(60))];
        _endTimeImgV.image = [UIImage imageNamed:@"vv"];
        
    }
    
    return _endTimeImgV;
}

#pragma mark-活动结束时间
-(void)creatEndTimeTitle{
    
    SLable * lbl = [[SLable alloc]initWithFrame:CGRectMake(GETSIZE(30), GETSIZE(10), GETSIZE(80), GETSIZE(15)) Text:@"活动结束时间" Font:12 Color:darkGray textAligMent:NSTextAlignmentCenter];
    [self.endTimeImgV addSubview:lbl];
    
    
    _lblEndTime = [[SLable alloc]initWithFrame:CGRectMake(GETSIZE(20), lbl.bottom, GETSIZE(100), GETSIZE(23)) Text:@"2016-9-30" Font:17 Color:gray textAligMent:NSTextAlignmentCenter];
    [self.endTimeImgV addSubview:_lblEndTime];
    
}


#pragma mark-预估返利
//背景图
-(UIImageView *)backImgV{
  
    if (!_backImgV) {
        
        _backImgV = [[UIImageView alloc]initWithFrame:CGRectMake(_whiteImgV.left-GETSIZE(5), GETSIZE(215), GETSIZE(110), GETSIZE(40))];

        _backImgV.image = [UIImage imageNamed:@"botGray"];
    }
    
    return _backImgV;
}

//数值
//数量
-(SLable *)yuGuBackL{
    
    if (!_yuGuBackL) {
        
       _yuGuBackL = [[SLable alloc]initWithFrame:CGRectMake(0, GETSIZE(5), GETSIZE(100), GETSIZE(30)) Text:@"预估返利25.6%" Font:10 Color:Red textAligMent:NSTextAlignmentCenter];
    }
    
    return _yuGuBackL;
    
}


#pragma mark-月销量
//背景图
-(UIImageView *)numImgV{
    
    if (!_numImgV) {
        
        _numImgV = [[UIImageView alloc]initWithFrame:CGRectMake(self.backImgV.right-GETSIZE(30), GETSIZE(215), GETSIZE(110), GETSIZE(40))];
        _numImgV.image = [UIImage imageNamed:@"botDarkGray"];
    }
    
    return _numImgV;
}

//数量
-(SLable *)numSellL{
    
    if (!_numSellL) {
        
        _numSellL = [[SLable alloc]initWithFrame:CGRectMake(0, GETSIZE(5), GETSIZE(100), GETSIZE(30)) Text:@"月销量81931" Font:10 Color:Red textAligMent:NSTextAlignmentCenter];
    }
    
    return _numSellL;
    
 }




#pragma mark-秒购背景
-(UIButton *)secKillBtn{
    
    if (!_secKillBtn) {
        
        _secKillBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _secKillBtn.frame = CGRectMake(self.numImgV.right-GETSIZE(25), GETSIZE(215), GETSIZE(117), GETSIZE(40));
        [_secKillBtn setBackgroundImage:[UIImage imageNamed:@"botRed"] forState:UIControlStateNormal];
        [_secKillBtn setTitle:@"立即秒购" forState:UIControlStateNormal];

    }
    return _secKillBtn;
}









- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
